home *** CD-ROM | disk | FTP | other *** search
/ 404 Jogos / CLJG.iso / Aventura / redbeard.swf / scripts / frame_3 / PlaceObject2_78_16 / CLIPACTIONRECORD onClipEvent(enterFrame).as
Encoding:
Text File  |  2008-09-12  |  2.7 KB  |  80 lines

  1. onClipEvent(enterFrame){
  2.    if(eval("_root.CodeMC:jump") == "on")
  3.    {
  4.       set("_root.CodeMC:lastjump","on");
  5.    }
  6.    else
  7.    {
  8.       set("_root.CodeMC:lastjump","off");
  9.    }
  10.    set("_root.CodeMC:jump","off");
  11.    set("_root.CodeMC:left","off");
  12.    set("_root.CodeMC:right","off");
  13.    if(Key.isDown(32))
  14.    {
  15.       set("_root.CodeMC:jump","on");
  16.    }
  17.    if(Key.isDown(37))
  18.    {
  19.       set("_root.CodeMC:left","on");
  20.    }
  21.    if(Key.isDown(39))
  22.    {
  23.       set("_root.CodeMC:right","on");
  24.    }
  25.    if(eval("_root.codeMC:state") == "Stopped")
  26.    {
  27.       if(Key.isDown(38))
  28.       {
  29.          if(getProperty("_root.PlayerMC", _Y) < eval("_root.codeMC:scrollPointLower") - 5)
  30.          {
  31.             setProperty("_root.PlayerMC", _Y, getProperty("_root.PlayerMC", _Y) + 5);
  32.             setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) + 5);
  33.          }
  34.          else if(getProperty("_root.PlayerMC", _Y) < eval("_root.codeMC:scrollPointLower") - 1)
  35.          {
  36.             setProperty("_root.PlayerMC", _Y, getProperty("_root.PlayerMC", _Y) + 1);
  37.             setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) + 1);
  38.          }
  39.       }
  40.       if(Key.isDown(40))
  41.       {
  42.          if(getProperty("_root.PlayerMC", _Y) > eval("_root.codeMC:scrollPointUpper") + 5)
  43.          {
  44.             setProperty("_root.PlayerMC", _Y, getProperty("_root.PlayerMC", _Y) - 5);
  45.             setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - 5);
  46.          }
  47.       }
  48.       else if(getProperty("_root.PlayerMC", _Y) > eval("_root.codeMC:scrollPointLower") + 1)
  49.       {
  50.          setProperty("_root.PlayerMC", _Y, getProperty("_root.PlayerMC", _Y) - 1);
  51.          setProperty("_root.backgroundMC", _Y, getProperty("_root.backgroundMC", _Y) - 1);
  52.       }
  53.    }
  54.    if(Key.isDown(81))
  55.    {
  56.       _root.score = eval("_root.codeMC:score");
  57.       set("_root.codeMC:lives",eval("_root.codeMC:lives") - 1);
  58.       set("_root.codeMC:state","Stopped");
  59.       set("_root.codeMC:blueSwitch","off");
  60.       set("_root.codeMC:redSwitch","off");
  61.       set("_root.codeMC:purpleSwitch","off");
  62.       set("_root.codeMC:air",5);
  63.       set("_root.codeMC:redgems",0);
  64.       set("_root.codeMC:bluegems",0);
  65.       set("_root.codeMC:purplegems",0);
  66.       set("_root.codeMC:colourActive","none");
  67.       set("_root.codeMC:currentGround",500);
  68.       setProperty("_root.backgroundMC", _X, 0);
  69.       setProperty("_root.backgroundMC", _Y, 0);
  70.       setProperty("_root.playerMC", _X, 197.2);
  71.       setProperty("_root.playerMC", _Y, 97);
  72.       set("_root:end",1);
  73.       set("_root.codeMC:deathspeed",0);
  74.    }
  75.    if(Key.isDown(70))
  76.    {
  77.       setProperty("_root.codeMC", _Y, 260);
  78.    }
  79. }
  80.